/*
8 6 7 2
1+2=8
2+3=6
3+4=7
4+5=8

1+4=9
1+4+2(2+3)=21
*/
#include <iostream>
#include <string>
using namespace std;
#define DEBUG
#define int long long
inline int read()
{
    int c=getchar(), f=1, x=0;
    if(c=='-') f*=-1, x=getchar();
    while(c<'0'&&'9'<c) c=getchar();
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    return f*x;
}
inline void write(long long x)
{
    if(x>=10) write(x/10);
    putchar(x%10+'0');
}

const int N=1e5+10;
int a[N], b[N], S[N], n, m;
int cnt[N];
long long ans;
void init()
{
    scanf("%lld %lld", &n, &m);// n=read(), m=read();
    for(int i=2; i<=n; i++)
        scanf("%lld", &S[i]);// S[i]=read();
    for(int i=1; i<=m; i++)
    {
        int music, count;
        scanf("%lld %lld", &music, &count);
        // int music=read(), count=read();
        cnt[music]+=count;
    }
}

inline void debug()
{
    for(int i=1; i<=n; i++)
        printf("%d ", cnt[i]);
    puts("");
}

void solve()
{
    init();
    // debug();
    
    // int zero=n;
    for(int i=1; i<n; i++)
    {
        if(cnt[i]==0) continue;
        ans=ans+1ll*cnt[i]*(S[i+1]);
        // printf("i:%d cnt:%d val:%d ans:%d\n", i, cnt[i], S[i], ans);
        cnt[i+1]-=cnt[i];
        cnt[i]=0;
        // debug();
    }

    if(cnt[n]==0) printf("%lld\n", ans);
    else puts("Impossible");
}

signed main()
{

    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif
    int T=1; //cin >> T; 
    while(T--) 
    {
        solve();
    }
    return 0;
}